export default (localforageIns: LocalForage) => {
  // 首次进来默认显示
  const isShowAime = ref(true);
  //  是否是首次关闭，首次关闭需要提示
  const isFirstClose = ref(true);
  // 显示提示
  const showAimeTip = ref(false);
  const showAime = () => {
    isShowAime.value = true;
    localforageIns.setItem('isShowAime', true);
  };
  const hideAime = () => {
    isShowAime.value = false;
    localforageIns.setItem('isShowAime', false);
    if (isFirstClose.value) {
      // 提示
      showAimeTip.value = true;
      isFirstClose.value = false;
    }
  };
  onMounted(() => {
    localforageIns.getItem('isShowAime').then(res => {
      if (typeof res === 'boolean') {
        isShowAime.value = res;
        isFirstClose.value = false;
      }
    });
  });
  return {
    isShowAime,
    showAime,
    hideAime,
    showAimeTip
  };
};
